<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
				<form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="param.orderNo"  placeholder="订单编号">
                        </div>
                        <div class="col-sm-2">
                        <select class="form-control" ng-model="param.status" style="color: black;"
                                 id="channelNo" >
                            <option value="" selected>--全部--</option>
                            <option value="0" >--未发货--</option>
                            <option value="1" >--已发货--</option>
                            <option value="2" >--确认收货--</option>
                            <option value="5" >--系统自动确认收货--</option>

                        </select>


                    </div>
                        <div class="col-sm-2">
                            <input type="text" id="startTime" name="startTime" ng-model="param.startTime" placeholder="请选择时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" id="endTime" name="endTime" ng-model="param.endTime" placeholder="请选择时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="param.consigneeName"  placeholder="输入搜索内容">
                        </div>

                        <div class="col-md-1">
                            <label class="col-sm-2"><button class="ifc-btn btn-primary" type="submit">查 询</button></label>
                        </div>
                            <div class="col-md-1">
                            <label class="col-sm-2"><button class="ifc-btn btn-dark" type="button" ng-click="clearSearch()">重  置</button></label>
                        </div>
                    </div>
				</form>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>

                        <th>序号</th>
                        <th>订单编号</th>
                        <th>收货人</th>
                        <th>商品名称</th>
                        <th>物流编号</th>
                        <th>联系方式</th>
                        <th>收货地址</th>
                        <th>后台修改的收货信息</th>
                        <th>兑换数量</th>
                        <th>下单时间</th>
                        <th>订单状态</th>
                        <th>操作</th>

                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">

                    	<!-- <td class="v-middle"><input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item)"/></td> -->
                        <td class="v-middle">{{$index + 1}}</td>


                        <td class="v-middle">{{item.orderNo}}</td>

                        <td class="v-middle" title="{{item.consigneeName}}">{{item.consigneeName  | limitTo:10}}</td>

                        <td class="v-middle" title="{{item.productName}}">
                            <a ng-click="getpinfo(item.productId)" style="color: green">
                                 {{item.productName | limitTo:10}}</a>
                           </td>
                        <td class="v-middle">{{item.logisticsNo}}</td>
                        <td class="v-middle">
                            <span ng-if="item.orderType==1">{{item.consigneePhone}}</span>
                        </td>
                        <td class="v-middle">{{item.consigneeAddress}}</td>
                        <td class="v-middle" title="{{item.updateConsigneeInfo}}" >
                            {{item.updateConsigneeInfo | limitTo:50}}</td>
                        <td class="v-middle">{{item.prouctNum}}</td>
                        <td class="v-middle">{{item.createTime}}</td>
                        <td class="v-middle">
                        <span ng-if="item.status==0">待发货</span>
                            <span ng-if="item.status==1">已发货</span>
                            <span ng-if="item.status==2">确认收货</span>
                            <span ng-if="item.status==5">系统确认收货</span>
                        </td>


                        <td class="v-middle">
                            <a ng-click="approvelook(item)" ng-if="item.status!=0" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>查看</a>
                            <a ng-click="approvelook(item)" ng-if="item.status==0"  class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>发货</a>

                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->
            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->
</div><!-- /.wrapper-md -->

<div class="cover" ng-show="firstApply1">
    <form class="form-horizontal"  name="btnform" id="btnform">
        <div class="firstApplyWrap" style="overflow-y: scroll">
            <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply1=false">&#xe608;</i></div>
            <div class="title" >
                <div class="modal-header">
                    <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
                    <h4 class="modal-title" id="CashLabel">订单管理</h4>
                </div>
                <div class="modal-body">
                    <div class="row">

                        <input type="hidden" ng-model="update.id"  >
                        <div class="form-group">
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                订单编号：</label>

                            <div class="col-sm-4">
                                {{orderDeatil.orderNo}}
                            </div>
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                兑换时间：</label>

                            <div class="col-sm-4">
                                {{orderDeatil.createTime}}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;">
                                商品名称：</label>

                            <div class="col-sm-4">
                                {{orderDeatil.productName}}
                            </div>
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                兑换数量：</label>

                            <div class="col-sm-4">
                                {{orderDeatil.prouctNum}}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;">
                                商品图片：</label>
                            <div class="col-sm-4">
                                <img src='{{orderDeatil.productImg}}'  style="width: 100%;">
                            </div>

                        </div>
                        <div class="line line-dashed b-b line-lg pull-in" ng-if="orderDeatil.orderType==1"></div>
                        <div class="form-group" ng-if="orderDeatil.orderType==1">
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                收货人：</label>
                            <div class="col-sm-4">
                                <span >{{orderDeatil.consigneeName}}</span>
                            </div>
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                               联系方式 ：</label>
                            <div class="col-sm-4">
                                <span >{{orderDeatil.consigneePhone}}</span>
                            </div>
                        </div>
                        <div class="form-group" ng-if="orderDeatil.orderType==1">
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;">
                                收货地址：</label>
                            <div class="col-sm-4">
                                <span >{{orderDeatil.consigneeAddress}}</span>

                            </div>
                            <span id="updateBtn" ng-if="btnflag=='Y'">
                            <button type="button" class="btn btn-primary" ng-click="updateCon();" >修改收货信息</button>
                            </span>
                        </div>

                        <div ng-if='flag=="Y" && orderDeatil.orderType==1 && orderDeatil.status!=0'>
                        <div class="line line-dashed b-b line-lg pull-in" ></div>
                            <div class="form-group" >
                                <label class="col-lg-2 col-sm-10 control-label" style="padding: 5px;color: red" >
                                    后台设置信息：</label>
                            </div>
                        <div class="form-group" >
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                收货人：</label>
                            <div class="col-sm-4">
                                <span >{{update.consigneeName}}</span>
                            </div>
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                联系方式 ：</label>
                            <div class="col-sm-4">
                                <span >{{update.consigneePhone}}</span>
                            </div>
                        </div>
                        <div class="form-group" ng-if="orderDeatil.orderType==1">
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;">
                                收货地址：</label>
                            <div class="col-sm-4">
                                <span >{{update.consigneeAddress}}</span>
                            </div>
                        </div>
                        </div>

                        <div id="updatecon" style="display:none">
                            <div class="line line-dashed b-b line-lg pull-in" ng-if="orderDeatil.orderType==1"></div>
                            <div class="form-group" >
                            <label class="col-lg-2 col-sm-10 control-label" style="padding: 5px;color: red" >
                                后台设置信息：</label>
                            </div>
                            <div class="form-group" >
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                收货人：</label>
                            <div class="col-sm-4">
                                <input type="text"   style="color: black;" class="form-control "   id="orderconsigneeName"  ng-model="update.consigneeName">
                            </div>
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                联系方式 ：</label>
                            <div class="col-sm-4">

                                <input type="text"   style="color: black;" class="form-control "    ng-model="update.consigneePhone" id="orderconsigneePhone">
                            </div>
                        </div>
                        <div class="form-group" >
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;">
                                收货地址：</label>
                            <div class="col-sm-4">

                                <textarea rows="5"   class="form-control " style="color: black;"  ng-model="update.consigneeAddress" id="orderconsigneeAddress" name="consigneeAddress">
                                </textarea>
                            </div>

                        </div>
                        </div>

                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group" ng-if="orderDeatil.orderType==1">

                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                物流公司编码：</label>
                            <div class="col-sm-4">
                                <!--<input type="text"  style="color: black;"  ng-if="orderDeatil.status==0" class="form-control "    ng-model="update.logisticsCode" >-->
                                <span ng-if="orderDeatil.status!=0">{{orderDeatil.logisticsCode}}</span>



                                    <select  ng-if="orderDeatil.status==0" class="form-control" ng-model="update.logisticsCode" style="color: black;"
                                            ng-options="d.logisticsCode as d.logisticsName for d in logList" id="logisticsCode" >
                                        <option value="" selected>--请选择--</option>


                                    </select>



                            </div>
                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                               物流快递单号 ：</label>
                            <div class="col-sm-4">
                                <input type="number" ng-if="orderDeatil.status==0" style="color: black;"  class="form-control "    ng-model="update.logisticsNo" >
                                  <span ng-if="orderDeatil.status!=0">{{orderDeatil.logisticsNo}}</span>
                            </div>
                        </div>
                        <div class="form-group" ng-if="orderDeatil.status==2||orderDeatil.status==5">

                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                确认收货时间：</label>

                            <div class="col-sm-4">
                                {{orderDeatil.receiptTime}}
                            </div>

                            <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;" >
                                确认收货方式 ：</label>

                            <div class="col-sm-4 ">
                                <span ng-if="orderDeatil.status==2">用户确认收货</span>
                                <span ng-if="orderDeatil.status==5">系统确认收货</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 col-sm-3 control-label" style="padding: 5px;">
                                订单状态：</label>
                            <label class="col-lg-2 col-sm-3 control-label" style="padding: 5px;">
                                <span ng-if="orderDeatil.status==0">待发货</span>
                                <span ng-if="orderDeatil.status==1">已发货</span>
                                <span ng-if="orderDeatil.status==2">确认收货</span>
                                <span ng-if="orderDeatil.status==5">系统确认收货</span>
                            </label>

                        </div>
                    </div>
                </div>
                <div class="modal-footer"  ng-if="orderDeatil.status==0 && orderDeatil.orderType==1">

                    <button type="button" class="btn btn-primary" ng-click="updateOrder();" ng-disabled="isDisabled">确定</button>
                </div>
            </div>

        </div>
    </form>
</div>







<div class="cover" ng-show="firstApply2">

        <div class="firstApplyWrap" style="overflow-y: scroll">
            <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply2=false">&#xe608;</i></div>
            <div class="title" >
                <div class="modal-header">
                    <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
                    <h4 class="modal-title" >商品详情</h4>
                </div>
                <div class="modal-body">
                    <!--资讯标题-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>商品名称:</label>

                        <div class="col-sm-8">
                            {{recordpinfo.productName}}
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>



                    <div class="form-group">
                        <!--是否邮寄-->
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>是否邮寄:</label>
                        <div class="col-sm-3">

                            <span ng-if="recordpinfo.productType==1">邮寄</span>
                            <span ng-if="recordpinfo.productType==2">非邮寄</span>
                        </div>
                        <!--商品积分-->
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>商品积分:</label>
                        <div class="col-sm-3">
                            {{recordpinfo.productPoint}}
                        </div>

                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>

                    <div class="form-group">
                        <!--总库存-->
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>总库存:</label>
                        <div class="col-sm-3">
                            {{recordpinfo.totalStock}}
                        </div>

                        <!--剩余库存-->
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>剩余库存:</label>
                        <div class="col-sm-3">
                            {{recordpinfo.remainStock}}
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>

                    <div class="form-group">
                        <!--商品价格-->
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>商品价格:</label>
                        <div class="col-sm-3">
                           {{recordpinfo.productPrice}}
                        </div>

                        <!--商品有效期-->
                        <label class="col-lg-2 col-sm-3 control-label" ><span class="text-danger wrapper-sm">*</span>商品有效期:</label>
                        <div class="col-sm-3">
                            {{recordpinfo.productTime}}
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>

                    <!--商品描述-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" >商品描述:</label>
                        <div class="col-sm-4">
                            {{recordpinfo.productDesc}}
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--兑换描述-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-5 control-label" >兑换描述:</label>
                        <div class="col-sm-4">
                        {{recordpinfo.cateGoryDesc}}
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-5 control-label" style="padding: 5px;">
                            商品图片：</label>
                        <div class="col-sm-4">
                            <img src='{{recordpinfo.productImg}}'  style="width: 100%;">
                        </div>

                    </div>

                </div>
                <!--<div class="modal-footer"  ng-if="orderDeatil.status==0 && orderDeatil.orderType==1">

                    <button type="button" class="btn btn-primary" ng-click="updateOrder();" ng-disabled="isDisabled">确定</button>
                </div>-->
            </div>

        </div>

</div>

<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap{
        width: 800px;
        height:600px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }
    .firstApplyWrap .title{
        font-size: 18px;
        color:#333;
        /*padding:18px 86px 0 80px;*/
        text-align: center;
        line-height: 2em;
    }
    .firstApplyWrap .closeBtn,.finishData .closeBtn{
        font-size: 30px;
        padding:5px 20px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }
    .finishData .closeBtn{
        position: absolute;
        top:10px;
        right:10px;
    }
    .firstApplyWrap .bkgIcon{
        position: absolute;
        left: 54px;
        top:87px;
        font-size: 50px;
        color:#FFB136;
    }
    .firstApplyWrap .applyBtnWrap{
        position: absolute;
        bottom: -2px;
        width: 100%;
    }
    .firstApplyWrap .applyBtn{
        width: 50%;
        height:70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color:#fff;
        cursor: pointer;
        float:left;
    }
    .firstApplyWrap .applyBtn:last-child{
        background: #5796FC;
    }


    .switch{
        display:none;
    }
    .switchlabel{
        position:relative;
        display: block;
        padding: 1px;
        border-radius: 24px;
        height: 22px;
        margin-bottom: 15px;
        background-color: #eee;
        cursor: pointer;
        vertical-align: top;
        -webkit-user-select: none;
    }
    .switchlabel:before{
        content: '';
        display: block;
        border-radius: 24px;
        height: 22px;
        background-color: #BFBFBF;
        -webkit-transform: scale(1, 1);
        -webkit-transition: all 0.3s ease;
    }
    .switchlabel:after{
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -11px;
        margin-left: -11px;
        width: 22px;
        height: 22px;
        border-radius: 22px;
        background-color: white;
        box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.08);
        -webkit-transform: translateX(-9px);
        -webkit-transition: all 0.3s ease;
    }
    .switch:checked~label:after{
        -webkit-transform: translateX(9px);
    }
    .switch:checked~label:before{
        background-color:green;
    }


</style>